<script>
	export default {
		globalData: {
			shareObj:{
				title:"功德PLUS",
				path:"/pages/index/index",
				imageUrl:"/static/muyuShare.png"
			},
			baseUrl: "https://static-c1e11f76-2036-46c7-bf0c-7a20c2f9d6f3.bspapp.com",
			buildPt: "",
			statusBarHeight: 0, // 状态导航栏高度
			navHeight: 0, // 总体高度
			navigationBarHeight: 0, // 导航栏高度(标题栏高度)
			iconHeight:0,
			iconWidth:0,
			customRight:0,
			customLeft:0,
			customTop:0,
			device:"",
			getSystemInfoSync:{}
		},
		onLaunch: function() {
			uni.getStorage({
				key:"num",
				success:(res)=> {},
				fail(err) {
					uni.setStorage({
						key:"num",
						data:'1'
					})
				}
			})
			uni.getStorage({
				key:"title",
				success:(res)=> {},
				fail(err) {
					uni.setStorage({
						key:"title",
						data:"功德"
					})
				}
			})
			uni.getStorage({
				key:"addType",
				success:(res)=> {},
				fail(err) {
					uni.setStorage({
						key:"addType",
						data:"plus"
					})
				}
			})
			uni.getStorage({
				key:"defaultNum",
				success:(res)=> {},
				fail(err) {
					uni.setStorage({
						key:"defaultNum",
						data:'0'
					})
				}
			})
			this.globalData.getSystemInfoSync = uni.getSystemInfoSync();
			this.globalData.device = this.globalData.getSystemInfoSync.platform;
			console.log(this.globalData.getSystemInfoSync);
			// 状态栏高度
			this.globalData.statusBarHeight = this.globalData.getSystemInfoSync.statusBarHeight
			// #ifdef MP-WEIXIN
			wx.setInnerAudioOption({
				obeyMuteSwitch:false
			})
			// this.buildPt = "MP-WEIXIN";
			// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
			const custom = wx.getMenuButtonBoundingClientRect();
			this.globalData.iconHeight = custom.height;
			this.globalData.iconWidth = custom.width;
			this.globalData.customRight = custom.right;
			this.globalData.customTop = custom.top;
			this.globalData.customLeft = custom.left;
			console.log(custom);
			// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
			this.globalData.navigationBarHeight = custom.height + (custom.top - this.globalData.statusBarHeight) * 2
			// console.log("导航栏高度："+this.globalData.navigationBarHeight)
			// 总体高度 = 状态栏高度 + 导航栏高度
			this.globalData.navHeight = this.globalData.navigationBarHeight + this.globalData.statusBarHeight
			// #endif
		},
		getSounds(){},
		onShow: function() {},
		onHide: function() {}
	}
</script>

<style lang="scss">
	/* 每个页面公共css */
	// #ifndef MP-WEIXIN
	* {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
	}
	// #endif
	view,
	text,
	cover-view{
		box-sizing: inherit;
		color: inherit;
		font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
		// #ifdef MP-WEIXIN
		box-sizing: border-box;
		margin: 0;
		padding: 0;
		// #endif
	}
	page {
		box-sizing: border-box;
		// padding-top: var(--status-bar-height);
		background-color: #000;
		min-height: 100%;
	}
</style>
